package cn.bb.bbstudy.controller;

import cn.bb.bbstudy.pojo.Invite;
import cn.bb.bbstudy.service.InviteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

@Controller
public class InviteController {

    @Autowired
    private InviteService inviteService;

    @GetMapping("invite")
    public String invite(Model model) {
        List<Invite> invites = inviteService.findAll();
        model.addAttribute("invites", invites);
        return "page/invite";
    }
}
